create rectangle method of canvas